#ifndef __UART_H__
#define	__UART_H__

#define GPA0CON		0xE0200000
#define UCON0 		0xE2900004
#define ULCON0 		0xE2900000
#define UMCON0 		0xE290000C
#define UFCON0 		0xE2900008
#define UBRDIV0 	0xE2900028
#define UDIVSLOT0	0xE290002C
#define UTRSTAT0	0xE2900010
#define UTXH0		0xE2900020	
#define URXH0		0xE2900024	

#define	GPA1CON		0xE0200020
#define ULCON2 		0xE2900800 
#define UCON2 		0xE2900804 
#define UFCON2 		0xE2900808 
#define UMCON2 		0xE290080C 
#define UTRSTAT2 	0xE2900810 
#define UERSTAT2 	0xE2900814 
#define UFSTAT2 	0xE2900818 
#define UMSTAT2 	0xE290081C 
#define UTXH2 		0xE2900820 
#define URXH2 		0xE2900824 
#define UBRDIV2 	0xE2900828 
#define UDIVSLOT2 	0xE290082C 
#define UINTP2 		0xE2900830 
#define UINTSP2 	0xE2900834 
#define UINTM2 		0xE2900838 

#define rGPA0CON	(*(volatile unsigned int *)GPA0CON)
#define rUCON0		(*(volatile unsigned int *)UCON0)
#define rULCON0		(*(volatile unsigned int *)ULCON0)
#define rUMCON0		(*(volatile unsigned int *)UMCON0)
#define rUFCON0		(*(volatile unsigned int *)UFCON0)
#define rUBRDIV0	(*(volatile unsigned int *)UBRDIV0)
#define rUDIVSLOT0	(*(volatile unsigned int *)UDIVSLOT0)
#define rUTRSTAT0	(*(volatile unsigned int *)UTRSTAT0)
#define rUTXH0		(*(volatile unsigned int *)UTXH0)
#define rURXH0		(*(volatile unsigned int *)URXH0)

#define	rGPA1CON	(*(volatile unsigned int *)GPA1CON)			
#define rULCON2 	(*(volatile unsigned int *)ULCON2)		
#define rUCON2 		(*(volatile unsigned int *)UCON2)		
#define rUFCON2 	(*(volatile unsigned int *)UFCON2) 			
#define rUMCON2 	(*(volatile unsigned int *)UMCON2)			
#define rUTRSTAT2 	(*(volatile unsigned int *)UTRSTAT2) 	
#define rUERSTAT2 	(*(volatile unsigned int *)UERSTAT2)	
#define rUFSTAT2 	(*(volatile unsigned int *)UFSTAT2) 	
#define rUMSTAT2 	(*(volatile unsigned int *)UMSTAT2)	
#define rUTXH2 		(*(volatile unsigned int *)UTXH2)	
#define rURXH2 		(*(volatile unsigned int *)URXH2)		
#define rUBRDIV2 	(*(volatile unsigned int *)UBRDIV2) 	
#define rUDIVSLOT2 	(*(volatile unsigned int *)UDIVSLOT2) 	
#define rUINTP2 	(*(volatile unsigned int *)UINTP2) 			
#define rUINTSP2 	(*(volatile unsigned int *)UINTSP2) 	
#define rUINTM2 	(*(volatile unsigned int *)UINTM2)		

//
//  Extern UART0 APIs
//
extern void uart_init(void);
extern void uart_putc(unsigned char c);
extern unsigned char uart_getc(void);
extern void uart_putString(const char *pString);
extern void uart_test(void);

//
//  Extern UART2 APIs
//
extern void uart2_init(void);
extern void uart2_putc(unsigned char c);
extern unsigned char uart2_getc(void);
extern void uart2_putString(const char *string);

#endif /* __UART_H__ */
